home *** CD-ROM | disk | FTP | other *** search
-
- function units_greendevil_setup()
- local unit = uniGetExecutor()
- unit:setVisibility(false,false)
- local pos = D3DXVECTOR3:new(0,0,0)
- pos = unit:getWorldPosition()
- for i = 0,rand(18,24) do
- createWorldEffect(ENET_EFFECT_METEORFALL,pos.x + rand(-80,80),pos.z + rand(-80,80))
- pause(0.2 + rand(0,0.3))
- end
- pos:delete()
- local gdv = getGreenDevilVictims();
- local index = 0;
- local vUID = getArrayElement(gdv,index)
- while(vUID ~= 0) do
- local victim = getTransformByUID(vUID)
- if(victim ~= nil) then
- uniSetLife(3.0 / victim:getMaxHP())
- victim:executeCommand(ENC_DAMAGED)
- end
- index = index + 1
- vUID = getArrayElement(gdv,index)
- end
- unit:destroy()
- end
-
- function units_greendevil_resetup()
- end
-
- registerCommand(ENSCRIPTSET_GREENDEVIL,ENC_SETUP,"units_greendevil_setup")
- registerCommand(ENSCRIPTSET_GREENDEVIL,ENC_RESETUP,"units_greendevil_resetup")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_GREENDEVIL)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "smallrobot.rmd"
- desc.ScriptSet = ENSCRIPTSET_GREENDEVIL
- desc.MoveType = ENMOVE_GROUNDORIENTED
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_SMALLROBOTSHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "smallrobot_shadow.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(52)
- unitDesc.group = 0
- unitDesc.order = 0
- unitDesc.unit_res_id = ENET_UNIT_GREENDEVIL
- unitDesc.unit_icon_id = "Smallrobot_h_small_normal.dds"
- unitDesc.active_id = "Smallrobot_h_small_active.dds"
- unitDesc.pressed_id = "Smallrobot_h_small_pressed.dds"
- unitDesc.big_icon_id = "Smallrobot_h_big_normal.dds"
- unitDesc.small_icon_id = "Smallrobot_u_stats.dds"
- unitDesc.HP = 4
- unitDesc.MP = 10
- unitDesc.WR = 1
- unitDesc.min_WR = 1
- unitDesc.WD = 3
- unitDesc.WR2 = 0
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 0
- unitDesc.ability = 0
- unitDesc.transport = 0
- unitDesc.value = 1
- unitDesc.race = 0
- unitDesc.fire_pause = 0.2
- unitDesc.move_pause = 0.5
- unitDesc.unit_info_scale = 0.08
- unitDesc.scn_name = "LBOT"
-